﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="RoomUI.aspx.cs" Inherits="ISSMoviePlex.Admin.RoomUI" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="RoomGridView" runat="server" 
        AutoGenerateColumns="False" DataSourceID="RoomDataSource" 
    DataKeyNames="RoomId" AllowPaging="True" CellPadding="4" ForeColor="#333333" 
        GridLines="None">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="RoomId" HeaderText="RoomId" 
                SortExpression="RoomId" InsertVisible="False" ReadOnly="True" />
            <asp:TemplateField HeaderText="Capacity" SortExpression="Capacity">
                <EditItemTemplate>
                    <asp:TextBox ID="tbCapacity" runat="server" Text='<%# Bind("Capacity") %>'></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="tbCapacity" CssClass="failureNotification" Display="Dynamic" 
                        ErrorMessage="Please enter capacity of the room"></asp:RequiredFieldValidator>
                    <asp:RangeValidator ID="RangeValidator1" runat="server" 
                        ControlToValidate="tbCapacity" CssClass="failureNotification" Display="Dynamic" 
                        ErrorMessage="Please enter a number between 30 and 70" MaximumValue="70" 
                        MinimumValue="30" Type="Integer"></asp:RangeValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Capacity") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:ObjectDataSource ID="RoomDataSource" runat="server" 
        DataObjectTypeName="ISSMoviePlex.DAL.Models.Room" DeleteMethod="DeleteRoom" 
        InsertMethod="AddRoom" SelectMethod="GetAllRooms" 
        TypeName="ISSMoviePlex.BLL.RoomBLL" UpdateMethod="UpdateRoom">
    </asp:ObjectDataSource>
    <br />
    <asp:Label ID="AddRoomLabel" runat="server" Text="Add New Room"></asp:Label>
    <br />
    <br />
    <asp:Label ID="CapacityLabel" runat="server" Text="Capacity"></asp:Label>
&nbsp;&nbsp;
    <asp:TextBox ID="CapacityTextBox" runat="server"></asp:TextBox>
    <asp:RequiredFieldValidator ID="CapacityRequiredFieldValidator" runat="server" 
        ControlToValidate="CapacityTextBox" CssClass="failureNotification" 
        ErrorMessage="Please enter capacity of the room" 
        ValidationGroup="AddRoomValidation" Display="Dynamic"></asp:RequiredFieldValidator>
    <asp:RangeValidator ID="CapacityRangeValidator" runat="server" 
        ControlToValidate="CapacityTextBox" CssClass="failureNotification" 
        ErrorMessage="Please enter a number between 30 and 70" MaximumValue="70" 
        MinimumValue="30" Type="Integer" ValidationGroup="AddRoomValidation" 
        Display="Dynamic"></asp:RangeValidator>
    <br />
    <asp:Button ID="AddButton" runat="server" onclick="AddButton_Click" Text="Add" 
        CommandName="AddRoom" ValidationGroup="AddRoomValidation" />
</asp:Content>
